<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OBS Form Upload Demo</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <style>
        .container .row {
            margin-bottom: 10px;
        }

        h1 {
            margin-top: 50px;
            margin-bottom: 30px;
        }

        label {
            line-height: 38px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 class="title">OBS Form Upload Demo Success</h1>
        <div class="row">
            <div class="col-3 label"><label>Status</label></div>
            <div class="col-4">
                <input class="form-control" type="text" readonly value="Success">
            </div>
        </div>

        <div class="row">
            <div class="col-3 label"><label>Bucket Name</label></div>
            <div class="col-4">
                <input name="bucket" class="form-control" type="text" readonly>
            </div>
        </div>

        <div class="row">
            <div class="col-3 label"><label>Filename</label></div>
            <div class="col-4">
                <input name="filename" class="form-control" type="text" readonly>
            </div>
        </div>

        <div class="row">
            <div class="col-3 label"><label>etag</label></div>
            <div class="col-4">
                <input name="etag" class="form-control" type="text" readonly>
            </div>
        </div>
    </div>

    <script>
        const queryObject = new URLSearchParams(location.search)
        const bucket = queryObject.get('bucket')
        const filename = queryObject.get('key')
        const etag = queryObject.get('etag')

        document.getElementsByName('bucket')[0].value = bucket
        document.getElementsByName('filename')[0].value = filename
        document.getElementsByName('etag')[0].value = etag

    </script>
</body>
</html>